<?php
/**
 * Created by PhpStorm.
 * User: SJAVA015
 * Date: 2018-05-10
 * Time: 16:27
 */

namespace app\home\controller;


use think\Controller;
use think\Db;
use think\View;
use app\home\model\total as MGn;
use app\home\model\shuju as Shuju;
class Zonglan extends Controller
{
    public function shoudian(){
//        dump('asdsds')
        $user=new MGn;

        $date_ss=date('Y-m-d');
        $this->assign('date_ss',$date_ss);

        //小时指标
        $list= $user->where('data','2018-05-10')->where('type','1')->select();
        $users1=$list->toArray();
        //开始售电
        $list2= $user->where('type','2')->select();
        $users2=$list2->toArray();
        //直接交易购电
        $list3= $user->where('type','3')->select();
        $users3=$list3->toArray();
        $this->assign("users3",$users3[0]);
        //负荷预测
        $list4= $user->where('type','4')->select();
        $users4=$list4->toArray();
        //利润预测
        $list5= $user->where('type','5')->select();
        $users5=$list5->toArray();

        $usersq=array($users1[0],$users2[0],$users3[0],$users4[0],$users5[0]);
        $this->assign("usersq",$usersq);

        //获取shuju表的数据以列表的形式显示
        $user2=new Shuju();
        $list=$user2->select();
        $users_2=$list->toArray();
        $this->assign("users_2",$users_2[0]);
        return view('admin-zonglan');
    }

}